package com.xiaoxi.chainofreponsibilitymode;

import com.xiaoxi.chainofreponsibilitymode.support.EvenSupport;
import com.xiaoxi.chainofreponsibilitymode.support.NoneSupport;
import com.xiaoxi.chainofreponsibilitymode.support.OddSupport;
import com.xiaoxi.chainofreponsibilitymode.trouble.Trouble;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.chainofreponsibilitymode
 * @ClassName Main
 * @Description TODO
 * @Date 2023/3/23 20:22
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {

        Trouble trouble = new Trouble("小名", 20);

        NoneSupport noneSupport = new NoneSupport("什么都不做");
        OddSupport oddSupport = new OddSupport("只做奇数");
        EvenSupport evenSupport = new EvenSupport("只做偶数");

        noneSupport.setSupport(oddSupport).setSupport(evenSupport);

        noneSupport.support(trouble);

    }
}
